﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="mycontrol.aspx.cs"  Inherits="mycontrol" validateRequest="false"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>file control</title>
    </head>
<body>
    <form id="form1" runat="server">
    Content:<br />
    <asp:TextBox ID="contentBox" runat="server" Height="318px" TextMode="MultiLine" 
        Width="760px"></asp:TextBox>
    <br />
    <asp:Label ID="Label1" runat="server" Text="file name"></asp:Label>
    <br />
    <asp:TextBox ID="nameBox" runat="server"></asp:TextBox>
    <asp:Button ID="saveButton" runat="server" Height="24px" Text="save" Width="80px" 
        onclick="saveButton_Click" />
    <br />
    <br />
    <asp:FileUpload ID="FileUpload1" runat="server" />
    <asp:Button ID="Button1" runat="server" onclick="upload_Click" Text="upload" />
    
    <table>
    <tr>
     <td colspan="2"> <div>
    <asp:TextBox ID="currentDirectory" runat="server" Width="386px"></asp:TextBox>  
         <asp:Button ID="browseDirec" runat="server" Text="browse" 
             onclick="browseDirec_Click" />   
         <asp:Button ID="parentDirectory" runat="server" Text="parent directory" 
             onclick="parentDirectory_Click" />      
    
    </div></td>
    
    </tr>
    <tr>
      <td>
      <asp:Label ID="Label2" runat="server" Width="386px"></asp:Label>
      </td>
    </tr>
      <tr valign="top">
          <td>
              <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" >
                  <Columns>
                      <asp:HyperLinkField DataNavigateUrlFields="currentLink"  DataNavigateUrlFormatString='{0}' DataTextField="name" Target="_blank" />
                  </Columns>
                  <EmptyDataTemplate>
                      No file
                  </EmptyDataTemplate>
              </asp:GridView>
              
            </td>
            <td>        
          
      <asp:GridView ID="directory" runat="server" AutoGenerateColumns="False">
        <Columns>                     
            <asp:templatefield>
                <itemtemplate>
                    <asp:LinkButton ID="LinkButton2" runat="server" CommandArgument='<%# Eval("Name") %>'
                        oncommand="LinkButton2_Command" Text='<%# Eval("Name") %>'></asp:LinkButton>
                </itemtemplate>
            </asp:templatefield>
        </Columns>
    </asp:GridView>
          
          </td>
      </tr>
    </table>
    
    
    </form>
</body>
</html>
